home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000062_icon-group-sender_Fri Mar 28 08:11:36 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
1KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SFBUU16993
for icon-group-addresses; Fri, 28 Mar 2003 08:11:30 -0700 (MST)
Message-Id: <200303281511.h2SFBUU16993@baskerville.CS.Arizona.EDU>
X-Sender: whm@mail.mse.com (Unverified)
Date: Thu, 27 Mar 2003 23:00:04 -0700
To: icon-group@cs.arizona.edu
From: "William H. Mitchell" <whm86@mse.com>
Subject: Currying and partial evaluation
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Speaking of currying and partial evaluation, I've been thinking about a
simple addition to Icon that would provide enough footing to do that sort
of stuff.
The expression expr1(expr2,...) currently has meaning if expr1 yields a
procedure, string, or integer. I'd like to see that expanded to have
meaning if expr1 is a list.
Example:
p(1,2)
could be expressed as
[p](1,2)
or
[p,1](2)
or
[p,1,2]()
With that in hand you might then say
pL := [push,L]
and then
every pL(1 to 10)
A higher-order function might return a list, but the user would need to
take no special steps to use it.
I haven't thought through what L(p) would mean if L[1] is a list... :)